package kr.pe.johnkim.chattingday.mobile.rest.service;

import kr.pe.johnkim.chattingday.mobile.domain.ChattingDayGatheringWarning;
import kr.pe.johnkim.chattingday.mobile.rest.dao.ChattingDayGatheringWarningDao;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author : johnkim <cale9797@gmail.com / Bettersoft Inc,.>
 * @Date : 12. 6. 12
 */
public class ChattingDayGatheringWarningServiceImpl implements ChattingDayGatheringWarningService {

    // SLF4J Logging
    private Logger logger = LoggerFactory.getLogger(ChattingDayGatheringWarningServiceImpl.class);

    @Autowired
    private ChattingDayGatheringWarningDao chattingDayGatheringWarningDao = null;

    /**
     * 불량 채팅방을 신고 한다.
     *
     * @param chattingDayGatheringWarning
     * @return
     */
    @Override
    public boolean registerGatheringWarning(ChattingDayGatheringWarning chattingDayGatheringWarning) {
        logger.info("registerGatheringWarning");

        return chattingDayGatheringWarningDao.registerGatheringWarning(chattingDayGatheringWarning);
    }

    /**
     * 불량 채팅방 신고했던 것을 비활성화 한다.
     *
     * @param chattingDayGatheringWarning
     * @return
     */
    @Override
    public boolean updateDeactivateGatheringWarning(ChattingDayGatheringWarning chattingDayGatheringWarning) {
        logger.info("updateDeactivateGatheringWarning");

        return chattingDayGatheringWarningDao.updateDeactivateGatheringWarning(chattingDayGatheringWarning);
    }

    /**
     * 해당 채팅방의 불량 신고 총 건수를 가져 온다.
     *
     * @param chattingDayGatheringWarning
     * @return
     */
    @Override
    public ChattingDayGatheringWarning selectGatheringWarningCount(ChattingDayGatheringWarning chattingDayGatheringWarning) {
        logger.info("selectGatheringWarningCount");

        return chattingDayGatheringWarningDao.selectGatheringWarningCount(chattingDayGatheringWarning);
    }
}
